package net.zjitc.service.impl;

import net.zjitc.dao.UserDao;
import net.zjitc.dao.impl.UserDaoImpl;
import net.zjitc.domain.User;
import net.zjitc.service.UserService;

import java.sql.SQLException;

/**
 * @Author admin
 * @Date 2019/3/4 11:06
 */
public class UserServiceImpl implements UserService {
    UserDao dao = new UserDaoImpl();
    @Override
    public User findByUsernameAndPassword(String username, String password) {
        return dao.findByUsernameAndPassword(username,password);
    }

    @Override
    public User findByUsername(String username) {
        return dao.findByUsername(username);
    }

    @Override
    public void add(User user) {
        dao.add(user);
    }

    @Override
    public User findById(String uid) {
        return dao.findById(uid);
    }

    @Override
    public void update(User user, String uid) throws SQLException {
        dao.update(user,uid);
    }
}
